import java.util.Locale;
import java.util.Scanner;

interface Class{1
    public static void func(){
    }
}
public class TextDemo {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int num = scanner.nextInt();
        if(num==1){
            System.out.println(1);
            System.exit(0);
        }
        long tem = (long)Math.sqrt(num);
        for(int i = 2;i<=tem;i++){
            while(num%i==0){
                System.out.print(i+" ");
                num/=i;
            }
        }
        System.out.print(num==1?"":num);

    }
    public static void main5(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int num = scanner.nextInt();
        if(num==1){
            System.out.println(1);
            System.exit(0);
        }
        int tem = 2;
        while(num!=1){
            if(num%tem==0){
                System.out.print(tem+" ");
                num/=tem;
            }else{
                tem++;
            }

        }
    }
    public static void main4(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String num = scanner.nextLine();
        num = num.substring(2);
        int a = Integer.valueOf(num,16);
        System.out.println(a);

    }
    public static void main3(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String str = scanner.nextLine();
        String[] ch = new String[13];
        int i = 0;
        int j = 0;
        int k = str.length()>=8?8:str.length();
        while(k<=str.length()&&j!=k){
           ch[i] = str.substring(j,k);
           if(str.length()-k>=8){
               j = k;
               k+=8;
           }else{
               j = k;
               k=str.length();
           }
            i++;


        }
        int tem = (str.length()%8)==0?(str.length()/8)-1:(str.length()/8);
        if(ch[tem].length()<=8){
            while(ch[tem].length()<8){
                ch[tem]+="0";
            }
        }
        for(int t = 0;t<=tem;t++){
            System.out.println(ch[t]);
        }
    }
    public static void main2(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int[] array = new int[1000];
        for(int i = 0;i<n;i++){
            int tem = scanner.nextInt();
            array[tem] = tem;
        }
        for(int i = 0;i<1000;i++){
            if(array[i]!=0){
                System.out.println(array[i]);
            }
        }

    }
    public static void main1(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String str1 = scanner.nextLine().toLowerCase();
        String str2 = scanner.nextLine().toLowerCase();
        String str3 = str1.replaceAll(str2,"");
        System.out.println(str1.length()-str3.length());
    }
}
/*import java.util.*;
public class Solution {
    public void merge(int A[], int m, int B[], int n) {
        int i =m-1;
        int k = n-1;
        int t = m+n-1;
        while(i>=0&&k>=0){
            if(A[i]>B[k]){
                A[t] = A[i];
                i--;
                t--;
            }else{
                A[t] = B[k];
                k--;
                t--;
            }
        }
        if(i>=0){
            while(i>=0){
                A[t] = A[i];
                i--;
                t--;
            }
        }
        if(k>=0){
            while(k>=0){
                A[t] = B[k];
                t--;
                k--;
            }
        }

    }*/

/*
import java.util.Scanner;
public class Main{
    public static void func(String str){
        int[] arr = new int[256];
        StringBuffer string = new StringBuffer();
        char ch;
        for(int i = 0;i<str.length();i++){
            ch = str.charAt(i);
            if(arr[ch]==0){
                string.append(ch);
            }
            arr[ch]++;
        }
        System.out.println(string.toString());

    }
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        while(scanner.hasNextLine()) {
            String str = scanner.nextLine();
            func(str);
        }

    }
}*/
